package com.yanmk.product.controller;

import com.yanmk.product.bean.Product;
import com.yanmk.product.service.ProductService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

/**
 * @program: cloud-demo
 * @description:
 * @author: Mr.Yan
 * @create: 2025-02-04 16:24
 **/
@RestController
public class ProductController {
@Autowired
private ProductService productService;
//查询商品列表
@RequestMapping (value = "/product/{id}", method = RequestMethod.GET)
 public Product getProductList(@PathVariable("id") Long productId) {
  Product product = productService.getProductById(productId);
return  product;
 }
}
